package hcn.protocol.brandnew.dengji.jianchayuyue;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 取消预约-请求消息 - ODS_02070011
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class CancelAppointRequest extends BaseRequest {

    /**
     * 条目
     */
    @XmlElement(name = "Item")
    private Item item;
    /**
     * 病人信息
     */
    @XmlElement(name = "Patient")
    private Patient patient;
    /**
     * 闭环信息列表
     */
    @XmlElementWrapper(name = "ClpInfos")
    @XmlElement(name = "ClpInfo")
    private List<ClpInfo> clpInfos;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Item {

        /**
         * 预约记录流水号
         */
        @XmlElement(name = "AppointsId")
        private String appointsId;
        /**
         * 机构代码
         */
        @XmlElement(name = "Organization")
        private String organization;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Patient {

        /**
         * 患者ID号
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 就诊流水号
         */
        @XmlElement(name = "SourceVisitId")
        private String sourceVisitId;
        /**
         * 门诊号码
         */
        @XmlElement(name = "ClinicId")
        private String clinicId;
        /**
         * 住院号码
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;
        /**
         * 患者类型
         */
        @XmlElement(name = "SourcePatientIdType")
        private String sourcePatientIdType;
        /**
         * 建档机构代码
         */
        @XmlElement(name = "AuthorOrganization")
        private String authorOrganization;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class ClpInfo {

        /**
         * 业务ID
         */
        @XmlElement(name = "BusinessID")
        private String businessID;
        /**
         * 业务循环节点ID
         */
        @XmlElement(name = "BusinessCircleID")
        private String businessCircleID;
        /**
         * 多主键业务ID
         */
        @XmlElement(name = "BusinessCompsiteID")
        private String businessCompsiteID;
        /**
         * 流程编码
         */
        @XmlElement(name = "FlowCode")
        private String flowCode;
        /**
         * 流程名称
         */
        @XmlElement(name = "FlowName")
        private String flowName;
        /**
         * 操作类型编码
         */
        @XmlElement(name = "OperateTypeCode")
        private String operateTypeCode;
        /**
         * 操作类型名称
         */
        @XmlElement(name = "OperateTypeName")
        private String operateTypeName;
        /**
         * 操作员工号
         */
        @XmlElement(name = "OperatorCode")
        private String operatorCode;
        /**
         * 操作员姓名
         */
        @XmlElement(name = "OperatorName")
        private String operatorName;
        /**
         * 操作科室代码
         */
        @XmlElement(name = "OperateDeptCode")
        private String operateDeptCode;
        /**
         * 操作科室姓名
         */
        @XmlElement(name = "OperateDeptName")
        private String operateDeptName;
        /**
         * 操作日期时间
         */
        @XmlElement(name = "OperateDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date operateDateTime;
        /**
         * 分组id
         */
        @XmlElement(name = "GroupId")
        private String groupId;
        /**
         * 分组名称
         */
        @XmlElement(name = "GroupName")
        private String groupName;
        /**
         * 备注信息
         */
        @XmlElement(name = "OperateComments")
        private String operateComments;
    }

}
